<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>vue实例</title>
  <script src="../static/vue.js"></script>
</head>
<body>
<div id="app">hello world</div>

<script>
  //生命周期函数就是vue实例在某一个时间点会自动执行的函数
  var vm = new Vue({
    el: '#app',
    beforeCreate: function () {
      console.log('beforeCreate')
    },
    created: function () {
      console.log('created')
    },
    beforeMount: function () {
      console.log(this.$el)
      console.log('beforeMount')
    },
    mounted: function () {
      console.log(this.$el)
      console.log('mounted')
    },
    beforeDestroy: function () {
      console.log('mounted')
    },
    destroy: function () {
      console.log('destroy')
    },
    beforeUpdate: function () {
      console.log('beforeUpdate')
    },
    updated: function () {
      console.log('updated')
    }

  })
</script>
</body>
</html>
